return wpt;
}
-#ifndef UTF8_SUPPORT
-char *
-bcr_iso8859_1_to_utf8(const char *s)
-{
- int len;
- char *res;
- unsigned char c;
- char *src, *dst;
-
- if (s == NULL) return NULL;
-
- len = 0;
- src = (char *)s;
- while ('\0' != (c = *src++))
- {
- len++;
- if (c & 0x80) len++;
- }
-
- src = (char *)s;
- dst = res = (void *) xmalloc(len + 1);
- while ('\0' != (c = *src++))
- {
- if (c & 0x80)
- {
- *dst++ = (0xc0 | (c >> 6));
- *dst++ = (c & 0xbf);
- }
- else
- {
- *dst++ = c;
- }
- }
- *dst = '\0';
- return res;
-}
-#endif
-
void
bcr_create_waypts_from_route(route_head *route)
{
}
if (src != NULL) xfree(src);
-#ifdef UTF8_SUPPORT
src = str_iso8859_1_to_utf8(buff);
-#else
- src = bcr_iso8859_1_to_utf8(buff); /* internal copy str_iso8859_1_to_utf8 */
-#endif
/* !! buff is now free and can be used */
c = bcr_next_char(src); /* skip spaces */
char * html_entitize(const char * str);
char * strip_html(const utf_string*);
char * strip_nastyhtml(const char * in);
-char * str_utf8_to_cp1252( const char * str );
-char * str_utf8_to_ascii( const char * str );
+
+/*
+ * Character encoding transformations.
+ */
+char * str_utf8_to_cp1252(const char * str);
+char * str_utf8_to_ascii(const char * str);
+char * str_iso8859_1_to_utf8(const char *str );
+
/* this lives in gpx.c */
time_t xml_parse_time( const char *cdatastr );
return result;
}
+/*
+ * str_iso8859_1_to_utf8
+ *
+ * converts the single byte charset ISO8859-1 (latin1) to UTF-8
+ */
+
+char *
+str_iso8859_1_to_utf8(const char *s)
+{
+ int len;
+ char *res;
+ unsigned char c;
+ char *src, *dst;
+
+ if (s == NULL) return NULL;
+
+ len = 0;
+ src = (char *)s;
+ while ('\0' != (c = *src++))
+ {
+ len++;
+ if (c & 0x80) len++;
+ }
+
+ src = (char *)s;
+ dst = res = (void *) xmalloc(len + 1);
+ while ('\0' != (c = *src++))
+ {
+ if (c & 0x80)
+ {
+ *dst++ = (0xc0 | (c >> 6));
+ *dst++ = (c & 0xbf);
+ }
+ else
+ {
+ *dst++ = c;
+ }
+ }
+ *dst = '\0';
+ return res;
+}
+
/*
* Get rid of potentially nasty HTML that would influence another record
* that includes;